<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->params['static'].'assets/js/bootbox.min.js',2); ?>
<div class="page-header">
							<h1>
							选择活动
							</h1>
</div>
<div class="row">
	<div class="col-xs-12">
		<div class="row">
								<div class="widget-box">
											<div class="widget-header widget-header-small">
												<h5 class="lighter"></h5>
											</div>

											<div class="widget-body">
												<div class="widget-main">
                                 <div class="table-responsive">
											<table id="sample-table-1" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														
														<th>活动名称</th>
														
														<th >活动内容</th>
														
														<th >活动要求</th>
														<th >额定参加人数</th>
														<th >已参加人数</th>
														<th >状态</th>
														

														<th>
															
															添加时间
														</th>
														
														<th>选择参加</th>
													</tr>
												</thead>

												<tbody>
												<?php
												  foreach($acs as $a){
													  $con = '<span class="label label-warning arrowed">未参加</span>';
													  foreach($stuAcs as $sa){
														  if($a->activityId == $sa->activityId){
															  $con  = '<span class="label label-success arrowed">已参加</span>';
															  break;
															}
														  
													  }
													 echo '
													<tr>
														<td>
															<a href="#">'.$a->name.'</a>
														</td>
														
														<td >
														<span display-content-id="'.$a->activityId.'" style="display:none;">'.$a->content.'</span>
															<button class="btn btn-sm btn-info" content-id="'.$a->activityId.'">
																详情
															</button>
														</td>
														
														<td>
														 <span display-requirement-id="'.$a->activityId.'" style="display:none;">'.$a->requirement.'</span>
														  <button class="btn btn-sm btn-warning" requirement-id="'.$a->activityId.'" >
														    要求
														  </button>
														</td>
														<td>'.$a->stunum.'</td>
														<td>'.$a->attendnum.'</td>
														<td>'.$con.'</td>
														
														<td>'.$a->addtime.'</td>
														

														
														<td>
															<div class="">
												               <a target="_blank" href="'.Yii::app()->CreateUrl('stuactivity/joinactivity',array('id'=>$a->activityId)).'"><button class="btn btn-xs btn-info">
																	<i class="icon-check bigger-120"></i>
																</button>

																
															</div>

														</td>
													</tr>';
												  }
                                                   ?>
												</tbody>
											</table>
										</div><!-- /.table-responsive -->
									</div>
								</div>
							</div>			

		</div>
	</div>
</div>
<script type="text/javascript">
   jQuery(function($){
	   
	   $('[requirement-id]').on("click",function(){
			var id = $(this).attr('requirement-id');
			bootbox.alert($("[display-requirement-id = "+id+"]").html(),function(){
				
				
			});

		  
		   
	   });
	   
	   $('[content-id]').on("click",function(){
			var id = $(this).attr('content-id');
			bootbox.alert($("[display-content-id = "+id+"]").html(),function(){
				
				
			});

		  
		   
	   });
	   
	   
   })
</script>	